import service from "@/server/serviceIndex";
import { useUseStore } from "@/stores/user";

// 获取用户信息方法
export const getUserInfoAPI = (uid) => {
    return service({
        method: "get",
        url: `/pipayshopapi/user-info/selectUserInfoByUid/${uid}`,
    });
};

// 获取用户提现信息方法
export const selectUserWithdrawalAPI = (userId) => {
    return service({
        method: "get",
        url: `/pipayshopapi/user-withdrawal/get/${userId}`,
    });
};

// 新增用户提现信息方法
export const insertUserWithdrawalAPI = (userId, userUid, walletAddress, cashWithdrawalAmount, FinalAmount) => {
    return service({
        method: "Post",
        url: "/pipayshopapi/user-withdrawal/insect",
        data: {
            userId: userId,
            uId: userUid,
            walletAddress: walletAddress,
            cashWithdrawalAmount: cashWithdrawalAmount,
            finalAmount: FinalAmount
        }
    });
};

// 取消用户提现信息方法
export const updateUserWithdrawalAPI = (id) => {
    return service({
        method: "Get",
        url: `/pipayshopapi/user-withdrawal/updateById/${id}`,
    });
};

// 获取手续费方法
export const withdrawalAPI = () => {
    return service({
        method: "get",
        url: '/pipayshopapi/withdrawal/selectAll',
    });
};